This forum is closed to new posts and
responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:
I have a repeat control whose vallue attribute is defined using SSJS. In the SSJS I'm checking completion of various fields. (Because the server is 8.5.1 I can't set them mandatory, because that will mean I can't unset them as mandatory using a partial refresh). If the fields are mandatory and have not been completed, I'm using facesContext.addMessage() to add an error message to the page.
The repeat control is within a panel which is rendered if !facesContext.getMessages().hasNext(). This works for the panel.
Within the repeat control I have added SSJS on the value attribute of my computed fields to return 0 if facesContext.getMessages().hasNext(). This occurs on five different computed fields. However, facesContext.getMessages().hasNext() is returning false for the SSJS on the computed fields.
I'm confused about the order of processing here. On the XPage I have a computed field that is not shown because of the SSJS result for another computed field. And this also means the SSJS for the value attribute of that computed field is also not triggered. So that is taking into account the result of SSJS run higher up the XPage. But when I add messages using facesContext.addMessage() in one SSJS and use facesContext.getMessages().hasNext() in SSJS in the value attribute of a computed field further down the page, it is ignored. Is this expected behaviour? Is this because component values are available immediately, but facesContext methods are not available until a later phase in the processing?
For now I've got round this by adding global variable that my SSJS validation is also setting, but it would be useful to know if this is a limitation of the facesContext object.
Feedback number WEBB8BNF34 created by ~Maria Xanjumiberg on 11/29/2010
Status: Open
Comments: